Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm running Ubuntu Linux with two displays. The one on the left is a laptop which I use for terminals and whatnot. Directly in front of me is a larger monitor I use for editing.
I noticed that every time I started
DrRacket
it would show up on the primary (left) screen. After some digging it appeared that the problem was inframe:size-pref-mixin
. My test program is at the end of this description.I believe that the issue is due to
get-display-left-top-inset
returning negative numbers in some cases. In this instance the left number is-1920
per the following trace statement I inserted intoget-sizes/maximzed
when I was figuring this out:This fails the first
<=
test I that I have changed resulting in the window position always being recalculated. I changed the second one to account for vertical placement of multiple monitors.With these changes I can turn off the secondary monitor, resulting in the window going to the primary monitor. Turning the secondary monitor back on puts the window back on the secondary monitor. I changed the display configuration to have the primary on the right and it worked there as well. I haven't done really extensive testing but the basic mechanism seems to work right except for the two items I have changed so maybe this is sufficient.
This is pretty thorny code and I don't have any Mac or Windows platforms. The two simple changes in this PR make it work for me but it may break code on other platforms.
Demo program is below (
github
apparently won't allow me to attach an.rkt
file). Run the program then move the window to another monitor and close it. Run the program again. Not sure how to unit test this so I didn't bother.I also noticed a very minor documentation error that should be self-explanatory.